import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Login from '../views/Login.vue'
import MovieList from '../views/movices/MovieList.vue'
import Register from '../views/Register.vue'
import MovieSite from '@/views/movices/MovieSite.vue'
import MovieDetail from '@/views/movices/MovieDetail.vue'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/login',
      // component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => Login
    },
    {
      path: '/movicelist',
      name: 'movicelist',
      component: MovieList

    },{
      path: '/register',
      name: 'register',
      component:Register,
    },{
      path: '/moviesite',
      name: 'moviesite',
      component: MovieSite
    },{
      path: '/movie/:id',
      name: 'movieDetail',
      component: MovieDetail
    }
  ],
})

export default router
